﻿<?php require 'header.php';?>
<?php 	if($login){?>
<?php
require 'db.php';
$masv=$UserDN;
$sql = "select MaSV,Holot,Ten,NgaySinh,GioiTinh,lcn.MaLop,TenChuyenNganh,Khoa,TenKhoa ";
$sql .= "from dbo_chuyennganh cn,dbo_nganh n,dbo_khoa k,dbo_lopchuyennganh lcn, dbo_sinhvien sv ";
$sql .= "where lcn.MaCN=cn.MaCN and n.MaKhoa=k.MaKhoa and n.MaNganh=cn.MaNganh and sv.MaLop=lcn.MaLop and MaSV=?";
$stmt = $db->prepare ( $sql );
$stmt->bindParam ( 1, $masv, PDO::PARAM_STR );
$stmt->execute ();
if ($stmt->rowCount ()) :
	$r = $stmt->fetch ();
	?>

<div class="row">
	<div class="col-md-6">
		<div class="panel panel-primary text-justify">
			<div class="panel-heading text-center">Thông tin sinh viên</div>
			<div class="list-group">
				<p class="list-group-item">
					<label>MSSV : </label><span id="mssv"><?php echo $r[0];?></span></p>
				<p class="list-group-item">
					<label>Họ tên : </label><?php echo $r[1].' '.$r[2];?></p>
				<p class="list-group-item">
					<label>Ngày sinh : </label><?php echo $r[3];?></p>
				<p class="list-group-item">
					<label>Giới tính : </label><?php if ($r[4]==1) echo "Nam"; else echo "Nữ"?></p>
				<p class="list-group-item"><label>Mã lớp : </label><?php echo $r[5];?>
				<p class="list-group-item">
					<label>Ngành học : </label><?php echo $r[6];?>
				<p class="list-group-item">
					<label>Khóa học : </label><?php echo $r[7];?>
				<p class="list-group-item">
					<label>Khoa : </label><?php echo $r[8];?>			
			</div>
			<div class="panel-footer btn-primary" id="footer"></div>
		</div>
	</div>
			<?php endif;?>
			<div class="col-md-6">

			<div id="Thongbao"></div>
		</div>
	</div> 
</div>
		<?php }?>
<?php require 'footer.php';?>